//=============================================
// MAIN MENU
//=============================================
var bMenu01=new Array()
bMenu01[0]='<a href="default9.asp?prg=all6001a.asp">Rare Alleles</a>'
var bMenu02=new Array()
bMenu02[0]='<a href="default9.asp?prg=all6002a.asp">Rare Alleles Report</a>'
var bMenu03=new Array()
bMenu03[0]='<a href="default9.asp?prg=all6003a.asp">Satistics1</a>'
var bMenu04=new Array()
bMenu04[0]='<a href="default9.asp?prg=all6004a.asp">Tool 1</a>'
var bMenu05=new Array()
bMenu05[0]='<a href="default9.asp?prg=all6005a.asp">Contact us</a>'
bMenu05[1]='<a href="default9.asp?prg=all6006a.asp">How to</a>'

//=============================================
// C A T A L O G U E    M E N U
//=============================================
var aMenu01=new Array()
aMenu01[0]='<a href="AdminMenu.asp?prg=all0009a.asp">Ethnic Origin</a>'
aMenu01[1]='<a href="AdminMenu.asp?prg=all0010a.asp">Continents</a>'
aMenu01[2]='<a href="AdminMenu.asp?prg=all0011a.asp">UN Subregions</a>'
aMenu01[3]='<a href="AdminMenu.asp?prg=all0012a.asp">Geographic Regions</a>'
aMenu01[4]='<a href="AdminMenu.asp?prg=all0013a.asp">Countries</a>'
aMenu01[5]='<a href="AdminMenu.asp?prg=all0014a.asp">Countries by Geographic Region</a>'
aMenu01[6]='<a href="AdminMenu.asp?prg=all0015a.asp">Ethnic Groups by Geographic Region</a>'
aMenu01[7]='<a href="AdminMenu.asp?prg=all0016a.asp">Ethnic Groups by Countries</a>'
aMenu01[8]='<a href="AdminMenu.asp?prg=all0017a.asp">Populations</a>'
aMenu01[9]='<a href="AdminMenu.asp?prg=all0018a.asp">Polymoprhic Regions</a>'
aMenu01[10]='<a href="AdminMenu.asp?prg=all0019a.asp">Geographic Regions</a>'
aMenu01[11]='<a href="AdminMenu.asp?prg=all0020a.asp">Locus</a>'
aMenu01[12]='<a href="AdminMenu.asp?prg=all0021a.asp">List of alleles</a>'
aMenu01[13]='<a href="AdminMenu.asp?prg=all0022a.asp">Cytokines</a>'
aMenu01[14]='<a href="AdminMenu.asp?prg=all0023a.asp">KIR genotype catalogue</a>'

//=============================================
// P R O C E S S E S     M E N U
//=============================================
var aMenu02=new Array()
aMenu02[0]='<a href="AdminMenu.asp?prg=all2001a.asp">Allele Entries</a>'
aMenu02[1]='<a href="AdminMenu.asp?prg=all2002a.asp">Cytokine Entries</a>'
aMenu02[2]='<a href="AdminMenu.asp?prg=all2003a.asp">Haplotype Entries</a>'
aMenu02[3]='<a href="AdminMenu.asp?prg=all2004a.asp">Genotype Entries</a>'
		
//=============================================
// S E A R C H E S     M E N U
//=============================================
var aMenu03=new Array()
aMenu03[0]='<a href="AdminMenu.asp?prg=all6002a.asp">KIR Genotype Search</a>'

//=============================================
// R E P O R T S     M E N U
//=============================================
var aMenu04=new Array()
aMenu04[0]='<a href="AdminMenu.asp?prg=all6001a.asp">Rare Alleles</a>'

//=============================================
// M A N A G E M E N T     M E N U
//=============================================
var aMenu05=new Array()
aMenu05[0]='<a href="AdminMenu.asp?prg=all0001a.asp">Website Setup</a>'
aMenu05[1]='<a href="AdminMenu.asp?prg=all0002a.asp">Programs</a>'
aMenu05[2]='<a href="AdminMenu.asp?prg=all0003a.asp">Users</a>'
aMenu05[3]='<a href="AdminMenu.asp?prg=all0004a.asp">Access</a>'
aMenu05[4]='<a href="AdminMenu.asp?prg=all0005a.asp">Sessions</a>'
aMenu05[5]='<a href="AdminMenu.asp?prg=all0006a.asp">Monitoring</a>'
aMenu05[6]='<a href="AdminMenu.asp?prg=all0007a.asp">Extra tables</a>'
aMenu05[7]='<a href="AdminMenu.asp?prg=all0008a.asp">Helps</a>'

//=============================================
// T O O L S     M E N U
//=============================================
var aMenu06=new Array()
aMenu06[0]='<a href="AdminMenu.asp?prg=all0000a.asp">Some tools</a>'

//=============================================
// M E N U    D E F A U L T    V A L U E S
//=============================================
var sMenuWitdh='165px' 					//... Default menu width ...//
var clMenuBackground='#99CCFF'  	    //... Menu Background ...//
var iHideDelay=250  				    //... Menu disappear speed (msec) ...//
var sHideMenu_OnClick="yes"             //... Hide menu when user clicks within menu ...//

//==========================================================
// B R O W S E R    C O N F I G U R A T I O N    V A L U E S
//==========================================================
var objIE4=document.all                              //... For the IE version ...// 
var objNS6=document.getElementById&&!document.all    //... For the Netscape version ...// 


//===================
// F U N C T I O N S
//===================
//... Comparing browser support (Hidden values) ...//
if (objIE4||objNS6)
    document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+sMenuWitdh+';background-color:'+clMenuBackground+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

//... Getting a position offset to display menu ...//
function fctGetPositionOffset(what, offsettype)
{
	var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
	var parentEl=what.offsetParent;
	while (parentEl!=null)
	{
		totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
		parentEl=parentEl.offsetParent;
	}
	return totaloffset;
}

function showhide(obj, e, visible, hidden, sMenuWitdh)
{
	if (objIE4||objNS6)
		dropmenuobj.style.left=dropmenuobj.style.top="-500px"
	if (sMenuWitdh!="")
	{
		dropmenuobj.widthobj=dropmenuobj.style
		dropmenuobj.widthobj.width=sMenuWitdh
	}
	if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
		obj.visibility=visible
	else if (e.type=="click")
		obj.visibility=hidden
}

function iecompattest()
{
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge)
{
	var edgeoffset=0
	if (whichedge=="rightedge")
	{
		var windowedge=objIE4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
		dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
		if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
			edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
	}
	else
	{
		var topedge=objIE4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
		var windowedge=objIE4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
		dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
		if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
		{ //move up?
			edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
		if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
			edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
		}
	}
	return edgeoffset
}

function populatemenu(what)
{
	if (objIE4||objNS6)
		dropmenuobj.innerHTML=what.join("")
}

//... MAIN FUNCTION TO DISPLAY MENU ...//
// objMenu: Set of menu options 
// e:       Event
// aMenuContents: Options Array
function dropdownmenu(objMenu, e, aMenuContents, sMenuWitdh)
{
	if (window.event) 
		event.cancelBubble=true
	else if (e.stopPropagation) e.stopPropagation()
		clearhidemenu()
	dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
	populatemenu(aMenuContents)

	if (objIE4||objNS6)
	{
		showhide(dropmenuobj.style, e, "visible", "hidden", sMenuWitdh)
		dropmenuobj.x=fctGetPositionOffset(objMenu, "left")
		dropmenuobj.y=fctGetPositionOffset(objMenu, "top")
		dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(objMenu, "rightedge")+"px"
		dropmenuobj.style.top=dropmenuobj.y+20+"px"
		//-clearbrowseredge(objMenu, "bottomedge")+objMenu.offsetHeight+"px"
	}

	return clickreturnvalue()
}

function clickreturnvalue()
{
	if (objIE4||objNS6) return false
	else return true
}

function contains_objNS6(a, b) 
{
	while (b.parentNode)
	if ((b = b.parentNode) == a)
		return true;
	return false;
}

function dynamichide(e)
{
	if (objIE4&&!dropmenuobj.contains(e.toElement))
		delayhidemenu()
	else if (objNS6&&e.currentTarget!= e.relatedTarget&& !contains_objNS6(e.currentTarget, e.relatedTarget))
		delayhidemenu()
}

function hidemenu(e)
{
	if (typeof dropmenuobj!="undefined")
	{
		if (objIE4||objNS6)
			dropmenuobj.style.visibility="hidden"
	}
}

function delayhidemenu()
{
	if (objIE4||objNS6)
		delayhide=setTimeout("hidemenu()",iHideDelay)
}

function clearhidemenu()
{
	if (typeof delayhide!="undefined")
		clearTimeout(delayhide)
}

if (sHideMenu_OnClick=="yes")
	document.onclick=hidemenu
